﻿#pragma once

#include "../../MirControls/MirImageControl.h"
#include "../../MirControls/MirItemCell.h"
#include "../../MirControls/MirLabel.h"
#include "../../MirControls/MirButton.h"
#include "../../../Shared/Data/ItemData.h"
#include <string>
#include <vector>

using namespace Client::MirControls;
using namespace Client::MirGraphics;
using namespace Client::MirNetwork;
using namespace Client::MirSounds;
namespace C = ClientPackets;

namespace Client::MirScenes::Dialogs
{
    class TradeDialog final : public MirImageControl
    {
    public:
        std::vector<MirItemCell*> Grid;
        MirLabel *NameLabel, *GoldLabel;
        MirButton *ConfirmButton, *CloseButton;

        virtual ~TradeDialog()
        {
            delete NameLabel;
            delete GoldLabel;
            delete ConfirmButton;
            delete CloseButton;
        }

        TradeDialog();

        void ChangeLockState(bool lockState, bool cancelled = false);

        void RefreshInterface();

        void TradeAccept();

        void TradeReset();

        void TradeCancel();

        MirItemCell *GetCell(unsigned long long id);
    };
    class GuestTradeDialog final : public MirImageControl
    {
    public:
        std::vector<MirItemCell*> GuestGrid;
        static std::vector<UserItem*> GuestItems;
        std::string GuestName;
        unsigned int GuestGold = 0;

        MirLabel *GuestNameLabel, *GuestGoldLabel;

        MirButton *ConfirmButton;

        virtual ~GuestTradeDialog()
        {
            delete GuestNameLabel;
            delete GuestGoldLabel;
            delete ConfirmButton;
        }

        GuestTradeDialog();

        void RefreshInterface();

        void TradeReset();
    };
}
